import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  { path: '/', 
    redirect:"/home",
  },
  { path: '/home',
    component: () => import('../view/Home.vue'),
    children:[
      {
        path: '/home',
        redirect:"/home/index",
      },
      { 
        path:"/home/index",
        component: () => import('../view/Index.vue'),
      },
      { 
        path:"/home/classic",
        component: () => import('../view/Classic.vue')
      },{ 
        path:"/home/publish",
        component: () => import('../view/Publish.vue')
      },
      { 
        path:"/home/manifest",
        component: () => import('../view/Manifest.vue')
      },
      { 
        path:"/home/mine",
        component: () => import('../view/Mine.vue')
      },
    ]  
  },
  {
    path: '/search',
    component: () => import('../view/Search.vue')
  },
  {
    path: '/login',
    component: () => import('../view/Login.vue')
  },
  {
    path:'/registry',
    component:() => import('../view/Registry.vue')
  },
  {
    path: '/detail/:id',
    component: () => import('../view/Detail.vue'),
    props: true,
  },
  {
    path: '/personalinfo',
    component: () => import('../view/PersonalInfo.vue')
  },
  {
    path: '/identity',
    component: () => import('../view/Identity.vue')
  },
  {
    path: '/username',
    component: () => import('../view/UserName.vue')
  },
  {
    path: '/enterprise',
    component: () => import('../view/Enterprise.vue')
  },{
    path: '/lookhistory',
    component: () => import('../view/Lookhistory.vue')
  },
  {
    path: "/:pathMatch(.*)*",
    component: () => import('../view/Error.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});


export default router;